↳ Prolog
↳ PrologToPiTRSProof
palindrome_in(L) → U1(L, halves_in(L, X1s, X2s, EvenOdd))
halves_in(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
last_in(.(H, T), X, .(H, M)) → U8(H, T, X, M, last_in(T, X, M))
last_in(.(T, []), T, []) → last_out(.(T, []), T, [])
U8(H, T, X, M, last_out(T, X, M)) → last_out(.(H, T), X, .(H, M))
U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
halves_in(.(X, []), .(X, []), [], odd) → halves_out(.(X, []), .(X, []), [], odd)
halves_in([], [], [], even) → halves_out([], [], [], even)
U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_out(Rests, Ts, Rs, EvenOdd)) → halves_out(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U4(L, X1s, X2s, eq_in(EvenOdd, odd))
eq_in(X, X) → eq_out(X, X)
U4(L, X1s, X2s, eq_out(EvenOdd, odd)) → U5(L, last_in(X1s, X, X2s))
U5(L, last_out(X1s, X, X2s)) → palindrome_out(L)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U2(L, X1s, X2s, eq_in(EvenOdd, even))
U2(L, X1s, X2s, eq_out(EvenOdd, even)) → U3(L, eq_in(X1s, X2s))
U3(L, eq_out(X1s, X2s)) → palindrome_out(L)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
palindrome_in(L) → U1(L, halves_in(L, X1s, X2s, EvenOdd))
halves_in(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
last_in(.(H, T), X, .(H, M)) → U8(H, T, X, M, last_in(T, X, M))
last_in(.(T, []), T, []) → last_out(.(T, []), T, [])
U8(H, T, X, M, last_out(T, X, M)) → last_out(.(H, T), X, .(H, M))
U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
halves_in(.(X, []), .(X, []), [], odd) → halves_out(.(X, []), .(X, []), [], odd)
halves_in([], [], [], even) → halves_out([], [], [], even)
U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_out(Rests, Ts, Rs, EvenOdd)) → halves_out(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U4(L, X1s, X2s, eq_in(EvenOdd, odd))
eq_in(X, X) → eq_out(X, X)
U4(L, X1s, X2s, eq_out(EvenOdd, odd)) → U5(L, last_in(X1s, X, X2s))
U5(L, last_out(X1s, X, X2s)) → palindrome_out(L)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U2(L, X1s, X2s, eq_in(EvenOdd, even))
U2(L, X1s, X2s, eq_out(EvenOdd, even)) → U3(L, eq_in(X1s, X2s))
U3(L, eq_out(X1s, X2s)) → palindrome_out(L)
PALINDROME_IN(L) → U11(L, halves_in(L, X1s, X2s, EvenOdd))
PALINDROME_IN(L) → HALVES_IN(L, X1s, X2s, EvenOdd)
HALVES_IN(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
HALVES_IN(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → LAST_IN(.(Y, Xs), R, Rests)
LAST_IN(.(H, T), X, .(H, M)) → U81(H, T, X, M, last_in(T, X, M))
LAST_IN(.(H, T), X, .(H, M)) → LAST_IN(T, X, M)
U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U71(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → HALVES_IN(Rests, Ts, Rs, EvenOdd)
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → U41(L, X1s, X2s, eq_in(EvenOdd, odd))
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → EQ_IN(EvenOdd, odd)
U41(L, X1s, X2s, eq_out(EvenOdd, odd)) → U51(L, last_in(X1s, X, X2s))
U41(L, X1s, X2s, eq_out(EvenOdd, odd)) → LAST_IN(X1s, X, X2s)
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → U21(L, X1s, X2s, eq_in(EvenOdd, even))
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → EQ_IN(EvenOdd, even)
U21(L, X1s, X2s, eq_out(EvenOdd, even)) → U31(L, eq_in(X1s, X2s))
U21(L, X1s, X2s, eq_out(EvenOdd, even)) → EQ_IN(X1s, X2s)
palindrome_in(L) → U1(L, halves_in(L, X1s, X2s, EvenOdd))
halves_in(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
last_in(.(H, T), X, .(H, M)) → U8(H, T, X, M, last_in(T, X, M))
last_in(.(T, []), T, []) → last_out(.(T, []), T, [])
U8(H, T, X, M, last_out(T, X, M)) → last_out(.(H, T), X, .(H, M))
U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
halves_in(.(X, []), .(X, []), [], odd) → halves_out(.(X, []), .(X, []), [], odd)
halves_in([], [], [], even) → halves_out([], [], [], even)
U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_out(Rests, Ts, Rs, EvenOdd)) → halves_out(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U4(L, X1s, X2s, eq_in(EvenOdd, odd))
eq_in(X, X) → eq_out(X, X)
U4(L, X1s, X2s, eq_out(EvenOdd, odd)) → U5(L, last_in(X1s, X, X2s))
U5(L, last_out(X1s, X, X2s)) → palindrome_out(L)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U2(L, X1s, X2s, eq_in(EvenOdd, even))
U2(L, X1s, X2s, eq_out(EvenOdd, even)) → U3(L, eq_in(X1s, X2s))
U3(L, eq_out(X1s, X2s)) → palindrome_out(L)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
PALINDROME_IN(L) → U11(L, halves_in(L, X1s, X2s, EvenOdd))
PALINDROME_IN(L) → HALVES_IN(L, X1s, X2s, EvenOdd)
HALVES_IN(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
HALVES_IN(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → LAST_IN(.(Y, Xs), R, Rests)
LAST_IN(.(H, T), X, .(H, M)) → U81(H, T, X, M, last_in(T, X, M))
LAST_IN(.(H, T), X, .(H, M)) → LAST_IN(T, X, M)
U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U71(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → HALVES_IN(Rests, Ts, Rs, EvenOdd)
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → U41(L, X1s, X2s, eq_in(EvenOdd, odd))
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → EQ_IN(EvenOdd, odd)
U41(L, X1s, X2s, eq_out(EvenOdd, odd)) → U51(L, last_in(X1s, X, X2s))
U41(L, X1s, X2s, eq_out(EvenOdd, odd)) → LAST_IN(X1s, X, X2s)
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → U21(L, X1s, X2s, eq_in(EvenOdd, even))
U11(L, halves_out(L, X1s, X2s, EvenOdd)) → EQ_IN(EvenOdd, even)
U21(L, X1s, X2s, eq_out(EvenOdd, even)) → U31(L, eq_in(X1s, X2s))
U21(L, X1s, X2s, eq_out(EvenOdd, even)) → EQ_IN(X1s, X2s)
palindrome_in(L) → U1(L, halves_in(L, X1s, X2s, EvenOdd))
halves_in(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
last_in(.(H, T), X, .(H, M)) → U8(H, T, X, M, last_in(T, X, M))
last_in(.(T, []), T, []) → last_out(.(T, []), T, [])
U8(H, T, X, M, last_out(T, X, M)) → last_out(.(H, T), X, .(H, M))
U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
halves_in(.(X, []), .(X, []), [], odd) → halves_out(.(X, []), .(X, []), [], odd)
halves_in([], [], [], even) → halves_out([], [], [], even)
U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_out(Rests, Ts, Rs, EvenOdd)) → halves_out(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U4(L, X1s, X2s, eq_in(EvenOdd, odd))
eq_in(X, X) → eq_out(X, X)
U4(L, X1s, X2s, eq_out(EvenOdd, odd)) → U5(L, last_in(X1s, X, X2s))
U5(L, last_out(X1s, X, X2s)) → palindrome_out(L)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U2(L, X1s, X2s, eq_in(EvenOdd, even))
U2(L, X1s, X2s, eq_out(EvenOdd, even)) → U3(L, eq_in(X1s, X2s))
U3(L, eq_out(X1s, X2s)) → palindrome_out(L)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
LAST_IN(.(H, T), X, .(H, M)) → LAST_IN(T, X, M)
palindrome_in(L) → U1(L, halves_in(L, X1s, X2s, EvenOdd))
halves_in(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
last_in(.(H, T), X, .(H, M)) → U8(H, T, X, M, last_in(T, X, M))
last_in(.(T, []), T, []) → last_out(.(T, []), T, [])
U8(H, T, X, M, last_out(T, X, M)) → last_out(.(H, T), X, .(H, M))
U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
halves_in(.(X, []), .(X, []), [], odd) → halves_out(.(X, []), .(X, []), [], odd)
halves_in([], [], [], even) → halves_out([], [], [], even)
U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_out(Rests, Ts, Rs, EvenOdd)) → halves_out(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U4(L, X1s, X2s, eq_in(EvenOdd, odd))
eq_in(X, X) → eq_out(X, X)
U4(L, X1s, X2s, eq_out(EvenOdd, odd)) → U5(L, last_in(X1s, X, X2s))
U5(L, last_out(X1s, X, X2s)) → palindrome_out(L)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U2(L, X1s, X2s, eq_in(EvenOdd, even))
U2(L, X1s, X2s, eq_out(EvenOdd, even)) → U3(L, eq_in(X1s, X2s))
U3(L, eq_out(X1s, X2s)) → palindrome_out(L)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ PiDP
LAST_IN(.(H, T), X, .(H, M)) → LAST_IN(T, X, M)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ QDPSizeChangeProof
↳ PiDP
LAST_IN(.(H, T)) → LAST_IN(T)
From the DPs we obtained the following set of size-change graphs:
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
HALVES_IN(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → HALVES_IN(Rests, Ts, Rs, EvenOdd)
palindrome_in(L) → U1(L, halves_in(L, X1s, X2s, EvenOdd))
halves_in(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
last_in(.(H, T), X, .(H, M)) → U8(H, T, X, M, last_in(T, X, M))
last_in(.(T, []), T, []) → last_out(.(T, []), T, [])
U8(H, T, X, M, last_out(T, X, M)) → last_out(.(H, T), X, .(H, M))
U6(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_in(Rests, Ts, Rs, EvenOdd))
halves_in(.(X, []), .(X, []), [], odd) → halves_out(.(X, []), .(X, []), [], odd)
halves_in([], [], [], even) → halves_out([], [], [], even)
U7(T, Y, Xs, Ts, R, Rs, EvenOdd, halves_out(Rests, Ts, Rs, EvenOdd)) → halves_out(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U4(L, X1s, X2s, eq_in(EvenOdd, odd))
eq_in(X, X) → eq_out(X, X)
U4(L, X1s, X2s, eq_out(EvenOdd, odd)) → U5(L, last_in(X1s, X, X2s))
U5(L, last_out(X1s, X, X2s)) → palindrome_out(L)
U1(L, halves_out(L, X1s, X2s, EvenOdd)) → U2(L, X1s, X2s, eq_in(EvenOdd, even))
U2(L, X1s, X2s, eq_out(EvenOdd, even)) → U3(L, eq_in(X1s, X2s))
U3(L, eq_out(X1s, X2s)) → palindrome_out(L)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
HALVES_IN(.(T, .(Y, Xs)), .(T, Ts), .(R, Rs), EvenOdd) → U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_in(.(Y, Xs), R, Rests))
U61(T, Y, Xs, Ts, R, Rs, EvenOdd, last_out(.(Y, Xs), R, Rests)) → HALVES_IN(Rests, Ts, Rs, EvenOdd)
last_in(.(H, T), X, .(H, M)) → U8(H, T, X, M, last_in(T, X, M))
last_in(.(T, []), T, []) → last_out(.(T, []), T, [])
U8(H, T, X, M, last_out(T, X, M)) → last_out(.(H, T), X, .(H, M))
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ RuleRemovalProof
HALVES_IN(.(T, .(Y, Xs))) → U61(T, last_in(.(Y, Xs)))
U61(T, last_out(R, Rests)) → HALVES_IN(Rests)
last_in(.(H, T)) → U8(H, last_in(T))
last_in(.(T, [])) → last_out(T, [])
U8(H, last_out(X, M)) → last_out(X, .(H, M))
last_in(x0)
U8(x0, x1)
HALVES_IN(.(T, .(Y, Xs))) → U61(T, last_in(.(Y, Xs)))
U61(T, last_out(R, Rests)) → HALVES_IN(Rests)
last_in(.(H, T)) → U8(H, last_in(T))
last_in(.(T, [])) → last_out(T, [])
U8(H, last_out(X, M)) → last_out(X, .(H, M))
POL(.(x1, x2)) = 2 + 2·x1 + 2·x2
POL(HALVES_IN(x1)) = 1 + 2·x1
POL(U61(x1, x2)) = 2 + 2·x1 + 2·x2
POL(U8(x1, x2)) = 1 + 2·x1 + 2·x2
POL([]) = 1
POL(last_in(x1)) = 2·x1
POL(last_out(x1, x2)) = 2 + 2·x1 + x2
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ RuleRemovalProof
↳ QDP
↳ PisEmptyProof
last_in(x0)
U8(x0, x1)